package com.xmx.ndmallwxapi.feign;

import com.xmx.common.utils.R;
import com.xmx.ndmallwxapi.vo.user.AddressVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient(value="user-center")
public interface UserFeignClient {
    /**
     * 地址服务
     */
    String addrPath = "/usercenter/address/";

    @GetMapping("/usercenter/address/findByAuid")
    R findlistByuid(@RequestParam("userId") Integer userId, @RequestParam("addressId") Integer addressId);

    @GetMapping("/usercenter/address/findlistByDefault")
    R findlistByDefault(Integer userId);

    @PostMapping("/usercenter/feedback/save")
    R save(@RequestBody Map<String, Object> feedback);


    @GetMapping("/usercenter/address/findListByUid")
    R findListByUid(@RequestParam("userId") Integer userId);

    @PostMapping("/usercenter/address/save")
    R saveaddress(@RequestBody AddressVo address);

    @PutMapping("/usercenter/address/update")
    R updateaddress(@RequestBody AddressVo address);

    @DeleteMapping("/usercenter/address/delete")
    R deleteaddress(@RequestBody Integer[] ids);

    @GetMapping("/usercenter/address/info/{id}")
    R infoaddress(@PathVariable("id") Integer id);
}
